<?php
require_once("config.php");
require_once("utils.php");

$db=new SQLite3($dbfilename);
$results=$db->query("SELECT * FROM item_t");
$row = array();
$i = 0;

while($res = $results->fetchArray(SQLITE3_ASSOC)){
	$row[$i]['pfn'] = $res['pfn'];
	$row[$i]['md5sum'] = $res['md5sum'];
	$i++;
}

$k=2;
$path_parts=pathinfo($row[$k]['pfn']);

$title='title::' . $path_parts['filename'];
echo $title;

//$ok=$db->exec("INSERT INTO item_t (pfn, filesize, md5sum) VALUES ('$pfn', '$v_filesize', '$v_md5sum')");
//if (!$ok) die("cannot add to database: $error");
//print_r($row); 

$db->close();